<%--
  @author Supun Viraj Rathnayaka
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<script src="${pageContext.request.contextPath}/js/printer.js" type="text/javascript"></script>
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/jquery.jqplot.css"/>
<script type="text/javascript" src="${pageContext.request.contextPath}/lib/jqplot/jquery.jqplot.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/lib/jqplot/jqplot.pieRenderer.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/lib/jqplot/jqplot.barRenderer.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/lib/jqplot/jqplot.categoryAxisRenderer.js"></script>
<script src="${pageContext.request.contextPath}/js/printer.js" type="text/javascript"></script>


<script type="text/javascript">
    $(function(){
        $('.land-table').dataTable({
            "sPaginationType":"full_numbers",
            "bDestroy":true,
            "oLanguage":{
                "sZeroRecords":$('#no-record').val(),
                "sLengthMenu":$('#display').val() + " _MENU_ " + $('#records').val(),
                "sSearch":$('#search').val(),
                "sInfo":$('#showing').val() + " _START_ " + $('#to').val() + " _END_ " + $('#of').val() + " _TOTAL_ " + $('#entries').val(),
                "sInfoEmpty":$('#no-record').val(),
                "oPaginate":{
                    "sFirst":$('#first').val(),
                    "sLast":$('#last').val(),
                    "sNext":$('#next').val(),
                    "sPrevious":$('#previous').val()
                }
            },
            "fnDrawCallback":function () {
                if ($('.dataTables_paginate span span.paginate_button').size()) {
                    $('.dataTables_paginate')[0].style.display = "block";
                } else {
                    $('.dataTables_paginate')[0].style.display = "none";
                }
            }
        });
    });

</script>

<div id="land-registration-module-home-title" class="module-home-title">
    <s:a href="reportModule.do">
        <span><img src="${pageContext.request.contextPath}/images/print.png" alt="Print">
            <s:label value="%{getText('reports.label')}"/></span>
    </s:a>
    <span class="module-title-breaker"> > </span>
    <s:a href="leaseDetailsReport.do">
        <span><img src="${pageContext.request.contextPath}/images/list.png" alt="">
            <s:label value="Lease Details Report"/></span>
    </s:a>
    <div id="back-button" align="right">
        <s:form><s:submit value="%{getText('back_btn.label')}" action="reportModule"/></s:form>
    </div>
</div>

<div id="printbtn" class="form-button-div right-align">
    <input type="button" style="margin:10" id="printBtnId" value="Print" onclick="printPage('init-land-report-list', 'A4', 'P');"/>
</div>

<div id="init-land-report-list">
    <div class="page-title center-align">
        <h2><s:label value="Detailed Lease Statistics"/></h2>
    </div>



<table class="width-100 margin-10-auto table land-table">
    <thead>
    <tr>
        <th><s:label value="File No"/></th>
        <th><s:label value="Lease No"/></th>
        <th><s:label value="Holder"/></th>
        <th><s:label value="Start Date"/></th>
        <th><s:label value="End Date"/></th>
        <th><s:label value="Valuation (Rs)"/></th>
        <th><s:label value="Total Paid (Rs) Rental"/></th>
        <th><s:label value="Arrears (Rs)"/></th>
        <th><s:label value="Actions"/></th>

    </tr>
    </thead>
    <tbody>
    <s:iterator status="listAli" value="leaseList">
        <tr>
            <td style="text-align: center"><s:property value="land.landFileNumber"/></td>
            <td style="text-align: center"><s:property value="referenceNo"/></td>
            <td style="text-align: center"><s:property value="holder.name"/></td>
            <td style="text-align: center"><s:property value="leaseDetail.leaseStartingDate"/></td>
            <td style="text-align: center"><s:property value="leaseDetail.leaseExpiringDate"/></td>
            <td style="text-align: center"><s:property value="valuation.valuationAmount"/></td>
            <td style="text-align: center"><s:property value="leaseDetail.annualRental"/></td>
            <%--<td style="text-align: center"><s:property value="leaseDetail.annualTax"/></td>--%>
            <td style="text-align: center"><s:property value="leaseDetail.arrearsAmount"/></td>
            <td style="text-align: center"><s:a title="View" href="loadRailwayLandDetails.do?landId=%{land.id}"> <img src="${pageContext.request.contextPath}/images/d-view.png" style="border:none; width:25px; height:25px;"/> </s:a></td>
        </tr>
    </s:iterator>
    </tbody>
</table>
</div>

<s:hidden id="display" value="%{getText('display.label')}"/>
<s:hidden id="records" value="%{getText('records.label')}"/>
<s:hidden id="search" value="%{getText('search.label')}"/>
<s:hidden id="no-record" value="%{getText('no_record.label')}"/>
<s:hidden id="showing" value="%{getText('showing.label')}"/>
<s:hidden id="to" value="%{getText('to.label')}"/>
<s:hidden id="of" value="%{getText('of.label')}"/>
<s:hidden id="entries" value="%{getText('entries.label')}"/>
<s:hidden id="first" value="%{getText('first.label')}"/>
<s:hidden id="last" value="%{getText('last.label')}"/>
<s:hidden id="next" value="%{getText('next.label')}"/>
<s:hidden id="previous" value="%{getText('previous.label')}"/>
<s:hidden id="all" value="%{getText('all.label')}"/>
<s:hidden id="rejected" value="%{getText('rejected.label')}"/>
<s:hidden id="approved" value="%{getText('approve.label')}"/>
<s:hidden id="pending" value="%{getText('pending.label')}"/>
<s:hidden id="data_entry" value="%{getText('data_entry.label')}"/>
<s:hidden id="land_status" value="%{getText('land_status.label')}"/>
<s:hidden id="no_of_lands" value="%{getText('no_of_lands.label')}"/>
<s:hidden id="all_lands_sum" value="%{getText('all_lands_sum.label')}"/>